#include <stdio.h>
#include <stdlib.h>

int func(int a, int b)
{
    int c;

    if (a < b)
    {
        printf("a must bigger than b\n");
        return -1;
    }
    
    if (a == b || b == 0)
        return 1;
    else
        return func(a-1, b)+func(a-1, b-1);
}

double func_2(int a, int b)
{
    int i, j;
    double c;
    double m[a+1][b+1]; 

    for (i = 0; i < a+1; i++)
    {
        for (j = 0; j <= (i>b?b:i); j++)
        {
            if (j == 0 || i == j)
                m[i][j] = 1;
            else
                m[i][j] = m[i-1][j] + m[i-1][j-1];
        }
    }
        
    c = m[a][b];

    return c;
}

double func_3(int a, int b)
{
    double t = 1;
    int i;

    for (i = 1; i <= b; i++)
    {
        t *= a--;
        t /= i;
    }

    return t;
}


int main(int argc, char *argv[])
{
    char *p = NULL;
        
    int a = 0;
        
    if (p == NULL | (a = 1))
        printf("%d\n", a);

    printf("%d\n", func(11, 11));
    printf("%g\n", func_2(100, 54));
    printf("%g\n", func_3(100, 54));

    return 0;
}
